rec_roomfandomcom-20200223-history
Circuit Diagrams
This page contains a collection of reusable circuits that solve certain functions and can be used to create larger circuits. Basic Functions Ring Store Since we have no memory chips at the moment, we can only store values by forming a ring. The ring can be extended by more chips that modify the value. Note however, that rings larger than one chip can be affected by the Ring Evaluation Order issue, if they have more than one entry point to the ring. Ring stores should be designed in a way that they do not modify the value in the default state, only once when required (e.g. when the user presses a button). Otherwise they will continuously do so. Increment This Circuit increments a number every time the button is pressed. Button Value A value usually has a value of 0 when not pressed, and 1 when pressed for a short amount of time. This circuit makes the button have 0 when not pressed and an arbitrary number when pressed. Button Values This circuit replaces the button output by arbitrary numbers. The example results in 3 when unpressed, and 7 when pressed. Let x be the desired value when unpressed, and y the desired value when pressed. Assign the red variable to x, and the green variable to (y-x). Pulse/Steady Conversions This circuit converts a value pulse to a steady value signal. Dice for example output the rolled number for a single tick and then output 0 again. This circuit always stores the last non-zero value. This circuit can be affected by the Ring Evaluation Order issue. A delay chip can be used to convert a steady input to a single tick pulse. Every time the input changes, the delay outputs that value for a single tick and then outputs 0 again. It is worth noting that the delay chip does always delay the signal by exactly one tick, but up to five ticks. This circuit does the same, but emits the pulse in the same tick that the value changes and outputs 0 in the second tick. It can be affected by the Ring Evaluation Order issue. Copy Value This circuit takes an input value from the left and copies it to the ring store on the right when a signal is triggered. It can be affected by the Ring Evaluation Order issue. Toggle The button toggles the output between 0 and 1. Use this variant with caution: It keeps toggling as long as there is a 1 input. Therefore, only use 1-tick-long pulse signals to trigger it. However this behavior might also be useful when it is possible that two consecutive ticks trigger the toggle signal, with no 0 in between. State Cycle The button cycles the output between an arbitrary number of states. In this example the output can have 3 states: 0, 1 and 2. If the number of states is set to 2, this behaves like the Toggle circuit above, therefore the State Cycle is a generalization of the Toggle circuit. RS Latch Sets the output to 1 when S is pressed and to 0 when R is pressed. RS Flip-Flop When C is triggered changes the output to 1 if S is 1 or to 0 if R is 1. JK Flip-Flop Like the RS Flip-Flop, but toggles the output state when C is triggered and S and R are 1. The circuit contains rings and therefore might be affected by the Ring Evaluation Order issue. Complex Functions Checkpoints The buttons can of course be replaced by goals. Each button that is pressed activates the next one. When the last button is pressed, it outputs 1 for a short time to the lower output, increments the lap counter at the top and resets all buttons. The number of checkpoints can be extended by repeating the sequence of button 2 (button, AND, Plus). Number Pad This circuit realizes an integer input field, using one button per digit. It could be used for example to create a calculator or a door pin code. The "From number" lines indicate a connection to a button with that number. Each OR chip on the left represents one digit in the binary representation button number. Therefore a button can be connected to multiple chips. Implementation Note: This circuit can be affected by the Ring Evaluation Order issue. Extending this Page Feel free to add more diagrams to this page. Different people have created templates that you can use to draw circuit diagrams if you like: * draw.io template * Inkscape SVG template Category:Tools